﻿@using CRM.Admin.Areas.Customer.Controllers
@using CRM.Admin.Contracts.Dto.Sys
@{
    ViewBag.Title = "营销地图";
}
@section head
{
    <link href="@Url.Content("~/ScriptPlugin/easyui/themes/gray/easyui.css")" rel="stylesheet" />
    <link href="@Url.Content("~/ScriptPlugin/easyui/themes/icon.css")" rel="stylesheet" />
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/easyui/jquery.easyui.min.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/easyui/locale/easyui-lang-zh_CN.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/KingsSharp.DataGrid.Filter.js")"></script>
    <script src="@Url.Content("~/ScriptPlugin/WdatePicker/js/WdatePicker.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/picdata.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/ScriptPlugin/webuploader/webuploader.js")"></script>
    <script type="text/javascript" src="@Url.Content("~/Scripts/KingsSharp.Uploader.js")"></script>
}
<div id="grid">
    <div id="toolpannel">
        <div class="content-pannel-buttons">
            <a><b class="p-icon-reload">刷新 </b></a>
            <a id="pickerB"><b class="p-icon-excle">导入Excel</b></a>
            <a onclick="$('#grid').datagrid('load')">
                <b class="p-icon-serch">查询</b>
            </a>
        </div>
        <div class="datagrid-filter-pannel" id="filterpannel">
            <table class="content-table-serch">
                <tr>
                    <th>
                        地区
                    </th>
                    <td>
                        <input type="text" name="Area" data-filter="true" />
                        <a class="p-icon-filter p-icon-filter-style" style="display: block; width: 22px;
                            height: 22px; float: left">@Html.GetFilterItem("Area", typeof(string))</a>
                        </td>
                        <th>
                            省份
                        </th>
                        <td>
                            <input type="text" name="Province" data-filter="true" />
                            <a class="p-icon-filter p-icon-filter-style" style="display: block; width: 22px;
                            height: 22px; float: left">@Html.GetFilterItem("Province", typeof(string))</a>
                        </td>
                        <th>行业</th>
                        <td>
                            <input type="text" name="Industry" data-filter="true" />
                            <a class="p-icon-filter p-icon-filter-style" style="display: block; width: 22px;
                            height: 22px; float: left">@Html.GetFilterItem("Industry", typeof(string))</a>
                        </td>                   
                        <th>品种</th>
                        <td>
                            <input type="text" name="ProdName" data-filter="true" />
                            <a class="p-icon-filter p-icon-filter-style" style="display: block; width: 22px;
                            height: 22px; float: left">@Html.GetFilterItem("ProdName", typeof(string))</a>
                        </td>
                    </tr>


                </table>
            </div>
        </div>
    </div>
    @section foot{
        <script type="text/javascript">
            function LoadCustmerInfoData() {
                var columns = [[
                                { field: "ck", checkbox: true },
                                { field: "Year", title: "年份", width: 90 },
                                { field: "Area", title: "地区", width: 100 },
                                { field: "Province", title: "省份", width: 90 },
                                { field: "Industry", title: "行业", width: 100 },
                                { field: "ProdName", title: "品种", width: 100 },
                                { field: "ReqWt", title: "需求量", width: 100 }

                ]];
                var parameter = {
                    title: "@Html.GetGridTitle("营销地图","行业需求情况")",
                    columns: columns,
                    url: "@Url.Content("~/Customer/Marketing/IndustryRequstGridata")",
                    pageNumber: 1
                };
                var grid = K.GetGridData("#grid", parameter).Grid;
            }
            LoadCustmerInfoData();
            K.PickeInit("datapicke");
            //导入功能
            var uploaderB = new K.Uploader().createExcle({
                swf: '@Url.Content("~/ScriptPlugin/webuploader/Uploader.swf")',
                server: '@Url.Content("~/Customer/Marketing/IndustryRequstExcelInert")',
                pick: '#pickerB',
                resize: false,
                auto: true
            }, {
                uploadSuccess: function (file, response) {

                    if (response.Filish) {

                        K.Alert(response.Message);
                    }
                    $("#grid").datagrid("load");
                },
                uploadError: function () {
                    K.Alert("上传出错");
                }
            });
        </script>

    }